package com.xiaozhengkeji.colastartboot.listener.user;

import com.xiaozhengkeji.colastartboot.events.user.UserLoginEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;


/**
 * 监听系统用户相关事件
 */
@Slf4j
@Component
public class SystemUserListener {
    @Async("PublicTaskExecutor")
    @EventListener
    @Order(1)
    public void systemUserLoginListener(UserLoginEvent eventSourceEvent) {
        log.info("用户登录事件监听：" + eventSourceEvent.getUsername());
    }
}
